#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    mybutton = new QPushButton(this);
    connect(mybutton,&QPushButton::clicked,this,&handleclick);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleclick()
{
        if(mybutton->text()==QString("HelloWorld!"))
        {
            mybutton->setText("HelloQt!");
        }
        else
        {
            mybutton->setText("HelloWorld!");
        }
}

